package com.gorkr;

/**
 * @author gorkr
 * @date 2022/01/15 11:37
 * 矩阵中的路径
 **/
public class L12 {

    public boolean exist(char[][] board, String word) {

        // 应该是个回溯问题



        return false;

    }

    public void backtrack(char[][] board, boolean[][] flag, int i, int j, String word, int index){

        // 判定
        if(word.charAt(index)==board[i][j]){
            return;
        }


        // 选择
        if(i-1>=0&&flag[i-1][j]){
            flag[i-1][j] = false;
            backtrack(board,flag,i-1,j,word,index);

         }
         if(i+1<=board[0].length-1&&flag[i+1][j]){

         }
         if(j-1>=0&&flag[i][j-1]){

         }
         if(j+1<=board[0].length-1&&flag[i][j+1]){

         }

    }

}
    